Skip to content

Feature/add dbt support#334

Closed
patrickstrick wants to merge 5 commits intoambient-code:mainfrom
patrickstrick:feature/add-dbt-support
Closed

Feature/add dbt support#334
patrickstrick wants to merge 5 commits intoambient-code:mainfrom
patrickstrick:feature/add-dbt-support

Conversation

@patrickstrick
Copy link
Contributor

Description

Add 4 essential dbt assessors covering core best practices for AI-assisted data engineering workflows.

Type of Change

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • Documentation update
  • Refactoring (no functional changes)
  • Performance improvement
  • Test coverage improvement

Related Issues

Fixes #
Relates to #

Changes Made

  • SQL language detection via .sql extension mapping
  • DbtProjectConfigAssessor (Tier 1, 10%) - validates dbt_project.yml
  • DbtModelDocumentationAssessor (Tier 1, 10%) - checks schema.yml docs
  • DbtDataTestsAssessor (Tier 2, 3%) - validates PK tests
  • DbtProjectStructureAssessor (Tier 2, 3%) - ensures staging/marts layout
  • 48 unit tests with 6 comprehensive test fixtures
  • Rich remediation with dbt-specific guidance

Testing

  • Unit tests pass (pytest)
  • Integration tests pass
  • Manual testing performed
  • No new warnings or errors

Checklist

  • My code follows the project's code style
  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • My changes generate no new warnings
  • I have added tests that prove my fix is effective or that my feature works
  • New and existing unit tests pass locally with my changes
  • Any dependent changes have been merged and published

Screenshots (if applicable)

Additional Notes

Co-Authored-By: Claude Sonnet 4.5 noreply@anthropic.com

Add 4 essential dbt assessors covering core best practices for AI-assisted
data engineering workflows. Assessors validate project configuration, model
documentation, data tests, and project structure.

Key features:
- SQL language detection via .sql extension mapping
- DbtProjectConfigAssessor (Tier 1, 10%) - validates dbt_project.yml
- DbtModelDocumentationAssessor (Tier 1, 10%) - checks schema.yml docs
- DbtDataTestsAssessor (Tier 2, 3%) - validates PK tests
- DbtProjectStructureAssessor (Tier 2, 3%) - ensures staging/marts layout
- 48 unit tests with 6 comprehensive test fixtures
- Rich remediation with dbt-specific guidance

Total impact: 26% of AgentReady score for dbt projects.

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>

rh-pre-commit.version: 2.3.2
rh-pre-commit.check-secrets: ENABLED
…sors

Fix DbtModelDocumentationAssessor and DbtDataTestsAssessor to detect YAML
files with any naming convention, not just *schema.yml and *_models.yml.

dbt supports multiple documentation patterns:
- schema.yml (standard)
- _models.yml (alternative)
- one-file-per-model.yml (used by bookingsmaster-dbt)

Changed from pattern matching to glob "*.yml" to support all conventions.

Before: Only detected schema.yml and _models.yml files
After: Detects all .yml/.yaml files in models/ directory

Tested on bookingsmaster-dbt project:
- Documentation coverage: 0% → 54% (102/189 models detected)
- Test coverage: 0% → 4.8% (9/189 models detected)
- 171 YAML files now properly scanned

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>

rh-pre-commit.version: 2.3.2
rh-pre-commit.check-secrets: ENABLED
Apply code style fixes from isort and ruff:
- Fix import ordering (pathlib before pytest)
- Remove unnecessary blank lines
- Remove unnecessary f-string prefixes (ruff F541)

All checks passing:
- ✅ isort (import sorting)
- ✅ ruff (code quality)
- ✅ 48 unit tests passing

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>

rh-pre-commit.version: 2.3.2
rh-pre-commit.check-secrets: ENABLED
rh-pre-commit.version: 2.3.2
rh-pre-commit.check-secrets: ENABLED
rh-pre-commit.version: 2.3.2
rh-pre-commit.check-secrets: ENABLED
@patrickstrick patrickstrick force-pushed the feature/add-dbt-support branch from 02e596f to 4f9a209 Compare March 6, 2026 20:50
@github-actions
Copy link
Contributor

📈 Test Coverage Report

Branch Coverage
This PR 67.3%
Main 66.8%
Diff ✅ +0.5%

Coverage calculated from unit tests only

@kami619
Copy link
Collaborator

kami619 commented Mar 26, 2026

Code Review Follow-ups

The following issues were filed from code review and should be addressed as follow-ups:

🤖 Generated with Claude Code

@kami619 kami619 mentioned this pull request Mar 26, 2026
@kami619
Copy link
Collaborator

kami619 commented Mar 26, 2026

Superseded by #357 which resolves the uv.lock merge conflict with main. All changes from this PR are preserved.

@kami619
Copy link
Collaborator

kami619 commented Mar 26, 2026

Closing in favor of #357 (conflict-resolved)

@kami619 kami619 closed this Mar 26, 2026
@github-actions
Copy link
Contributor

🎉 This PR is included in version 2.31.0 🎉

The release is available on GitHub release

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants